package tw.com.hitevision.whiteboard.android.display;

import android.util.Log;

import tw.com.hitevision.whiteboard.android.Props;

// deal fake 4k
public class DisplayDpiHelper {
    private static final String TAG = DisplayDpiHelper.class.getSimpleName();
    private float factor = 1f;
    private static DisplayDpiHelper instance;

    public static DisplayDpiHelper getInstance() {
        if (instance == null) {
            instance = new DisplayDpiHelper();
        }

        return instance;
    }

    private DisplayDpiHelper() {
        factor = 1.0f;
    }

    public float getFactor() {
        return factor;
    }

    public float get4kFactor() {
        return factor;
    }

    public float getFake4kFactor() {
        return (Props.isFake4k()) ? factor : 1f;
    }

    public void setFactor(int width, int height) {
        this.factor = width / 1920f;
    }

    private void log(String s) {
        Log.d(TAG, s);
    }
}
